package edu.ustb.efws.pipeline.domain;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Date;
import java.util.Objects;
import java.util.StringJoiner;

/**
 * 危险级别日志
 *
 * @author TS Group
 */
public class RiskLog {
    @ApiModelProperty("编号")
    private Long id;
    @ApiModelProperty("position编号")
    private Integer positionId;
    @ApiModelProperty("月份(yyyyMM)")
    private Integer month;
    @ApiModelProperty("电流")
    private Float i;
    @ApiModelProperty("电压")
    private Float u;
    @ApiModelProperty("功率")
    private Float p;
    @ApiModelProperty("最大电流")
    private Float maxI;
    @ApiModelProperty("氧气浓度")
    private Float o;
    @ApiModelProperty("温度")
    private Float t;
    @ApiModelProperty("湿度")
    private Float h;
    @ApiModelProperty("危险等级")
    private String riskGrade;
    @ApiModelProperty("危险类型")
    private Integer riskType;
    @ApiModelProperty("分数")
    private Float score;
    @ApiModelProperty("ipt设备数据采集时间")
    private Date iptTime;
    @ApiModelProperty("thos设备数据采集时间")
    private Date thosTime;
    @ApiModelProperty("创建时间")
    private Date createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getPositionId() {
        return positionId;
    }

    public void setPositionId(Integer positionId) {
        this.positionId = positionId;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public Float getI() {
        return i;
    }

    public void setI(Float i) {
        this.i = i;
    }

    public Float getU() {
        return u;
    }

    public void setU(Float u) {
        this.u = u;
    }

    public Float getP() {
        return p;
    }

    public void setP(Float p) {
        this.p = p;
    }

    public Float getMaxI() {
        return maxI;
    }

    public void setMaxI(Float maxI) {
        this.maxI = maxI;
    }

    public Float getO() {
        return o;
    }

    public void setO(Float o) {
        this.o = o;
    }

    public Float getT() {
        return t;
    }

    public void setT(Float t) {
        this.t = t;
    }

    public Float getH() {
        return h;
    }

    public void setH(Float h) {
        this.h = h;
    }

    public String getRiskGrade() {
        return riskGrade;
    }

    public void setRiskGrade(String riskGrade) {
        this.riskGrade = riskGrade;
    }

    public Integer getRiskType() {
        return riskType;
    }

    public void setRiskType(Integer riskType) {
        this.riskType = riskType;
    }

    public Float getScore() {
        return score;
    }

    public void setScore(Float score) {
        this.score = score;
    }

    public Date getIptTime() {
        return iptTime;
    }

    public void setIptTime(Date iptTime) {
        this.iptTime = iptTime;
    }

    public Date getThosTime() {
        return thosTime;
    }

    public void setThosTime(Date thosTime) {
        this.thosTime = thosTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o1) {
        if (this == o1) return true;
        if (o1 == null || getClass() != o1.getClass()) return false;
        RiskLog log = (RiskLog) o1;
        return Objects.equals(id, log.id) &&
                Objects.equals(positionId, log.positionId) &&
                Objects.equals(month, log.month) &&
                Objects.equals(i, log.i) &&
                Objects.equals(u, log.u) &&
                Objects.equals(p, log.p) &&
                Objects.equals(maxI, log.maxI) &&
                Objects.equals(o, log.o) &&
                Objects.equals(t, log.t) &&
                Objects.equals(h, log.h) &&
                Objects.equals(riskGrade, log.riskGrade) &&
                Objects.equals(riskType, log.riskType) &&
                Objects.equals(score, log.score) &&
                Objects.equals(iptTime, log.iptTime) &&
                Objects.equals(thosTime, log.thosTime) &&
                Objects.equals(createTime, log.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, positionId, month, i, u, p, maxI, o, t, h, riskGrade, riskType, score, iptTime, thosTime, createTime);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("positionId", positionId)
                .append("month", month)
                .append("i", i)
                .append("u", u)
                .append("p", p)
                .append("maxI", maxI)
                .append("o", o)
                .append("t", t)
                .append("h", h)
                .append("riskGrade", riskGrade)
                .append("riskType", riskType)
                .append("score", score)
                .append("iptTime", iptTime)
                .append("thosTime", thosTime)
                .append("createTime", createTime)
                .toString();
    }
}
